xen.git
18 years agohvm: Improve in-Xen PIO emulation to better handle string PIO
Keir Fraser [Sat, 12 Jan 2008 11:13:57 +0000 (11:13 +0000)]
hvm: Improve in-Xen PIO emulation to better handle string PIO
instructions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agosvm: Properly mask unsupported bits in CPUID_80000001_ECX.
Keir Fraser [Sat, 12 Jan 2008 09:29:38 +0000 (09:29 +0000)]
svm: Properly mask unsupported bits in CPUID_80000001_ECX.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: hpet: Tidy up hpet_to_ns_limit calculation.
Keir Fraser [Fri, 11 Jan 2008 11:01:36 +0000 (11:01 +0000)]
hvm: hpet: Tidy up hpet_to_ns_limit calculation.
Suggested by Haitao Shan @ Intel.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agovmxassist: Emulate CLTS.
Keir Fraser [Fri, 11 Jan 2008 10:59:48 +0000 (10:59 +0000)]
vmxassist: Emulate CLTS.
Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86 hvm: hvm_maybe_deassert_evtchn_irq() needs to be called early in
Keir Fraser [Fri, 11 Jan 2008 10:53:44 +0000 (10:53 +0000)]
x86 hvm: hvm_maybe_deassert_evtchn_irq() needs to be called early in
vmexit handling, before IO-APIC can be EOIed or unmasked and resample
the fake INTx line.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86_emulate: Fix near CALL/JMP <reg,mem>. Broken by c/s 16491.
Keir Fraser [Thu, 10 Jan 2008 22:53:43 +0000 (22:53 +0000)]
x86_emulate: Fix near CALL/JMP <reg,mem>. Broken by c/s 16491.
Thanks to AMD for narrowing this one down.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86_emulate: Certain opcodes are only valid with a memory operand.
Keir Fraser [Thu, 10 Jan 2008 22:52:40 +0000 (22:52 +0000)]
x86_emulate: Certain opcodes are only valid with a memory operand.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoFix network-bridge shell quoting.
Keir Fraser [Thu, 10 Jan 2008 15:30:46 +0000 (15:30 +0000)]
Fix network-bridge shell quoting.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
18 years agoAdded tag 3.2.0-rc5 for changeset 36bb2ab4722733d919d32e4555eb46cc6a06cb8f
Keir Fraser [Wed, 9 Jan 2008 22:21:58 +0000 (22:21 +0000)]
Added tag 3.2.0-rc5 for changeset 36bb2ab4722733d919d32e4555eb46cc6a06cb8f

18 years agoUpdate version to 3.2.0-rc5
Keir Fraser [Wed, 9 Jan 2008 22:21:49 +0000 (22:21 +0000)]
Update version to 3.2.0-rc5

18 years agox86_emulate: Fix handling of RIP-relative addressing.
Keir Fraser [Wed, 9 Jan 2008 22:21:28 +0000 (22:21 +0000)]
x86_emulate: Fix handling of RIP-relative addressing.
The handling of SHLD/SHRD introduced in 16696:b5b3e27f1af3f7 was
incorrect; thanks to Gary Grebus @ Virtual Iron for spotting it.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agovt-d: Fix print_vtd_entries walk VTd mapping table.
Keir Fraser [Wed, 9 Jan 2008 10:35:52 +0000 (10:35 +0000)]
vt-d: Fix print_vtd_entries walk VTd mapping table.

DMA request to above guest physical memory will cause VTd fault, in
which print_vtd_entries() tries to walk VTd mapping table. However,
during walking, current Xen code didn't check if the PTE is valid and
may access to invalid memory address.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
18 years agohvm: hpet: Clamp period to sane values to prevent excessive looping in
Keir Fraser [Wed, 9 Jan 2008 10:32:13 +0000 (10:32 +0000)]
hvm: hpet: Clamp period to sane values to prevent excessive looping in
hpet_timer_fn(), or excessive numbers of set_timer() callbacks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86_emulate: Correct RIP-relative addressing offset for SHLD/SHRD with
Keir Fraser [Wed, 9 Jan 2008 10:11:31 +0000 (10:11 +0000)]
x86_emulate: Correct RIP-relative addressing offset for SHLD/SHRD with
immediate byte third operand.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoFix x86_emulate() handling of imul with immediate operands.
Keir Fraser [Wed, 9 Jan 2008 10:09:04 +0000 (10:09 +0000)]
Fix x86_emulate() handling of imul with immediate operands.

This fixes a repeatable crash in RHEL 4.2 ext2 filesystem during boot.

Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
18 years agox86: Fix a comment in get_page_type().
Keir Fraser [Tue, 8 Jan 2008 16:45:08 +0000 (16:45 +0000)]
x86: Fix a comment in get_page_type().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: hpet: Fix overflow when converting to nanoseconds.
Keir Fraser [Tue, 8 Jan 2008 16:20:04 +0000 (16:20 +0000)]
hvm: hpet: Fix overflow when converting to nanoseconds.

Currently in hpet_tick_to_ns, the approach is multiplying first, which
easily causes overflow when tick is quite large. The patch cannot
handle arbitratry large ticks duo to the precision requirement and
64bit's value range. But by optimize the equation, a larger ticks than
current code can be supported. Also an overflow check is added before
the calculation.

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: Fix evtchn-to-fake-pci interrupt propagation.
Keir Fraser [Tue, 8 Jan 2008 15:55:29 +0000 (15:55 +0000)]
hvm: Fix evtchn-to-fake-pci interrupt propagation.

Previously the evtchn_upcall_pending flag would only ever be sampled
on VCPU0, possibly leading to long delays in deasserting the
fake-pci-device INTx line if the interrupt is actually delivered to
other than VCPU0.

Diagnosed by Ian Jackson <ian.jackson@eu.citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoAdd a ChangeLog file
Keir Fraser [Tue, 8 Jan 2008 14:35:18 +0000 (14:35 +0000)]
Add a ChangeLog file

Add a file for tracking API/ABI changes and additions.

Signed-off-by: John Levon <john.levon@sun.com>
18 years agohvm: time: Fixes to 'SYNC' (no_missed_ticks_pending) timer handling.
Keir Fraser [Tue, 8 Jan 2008 14:31:23 +0000 (14:31 +0000)]
hvm: time: Fixes to 'SYNC' (no_missed_ticks_pending) timer handling.
Based on a patch by Dave Winchell <dwinchell@virtualiron.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: hpet: Fix per-timer enable/disable.
Keir Fraser [Tue, 8 Jan 2008 13:57:45 +0000 (13:57 +0000)]
hvm: hpet: Fix per-timer enable/disable.

The enable/disable per timer interrupt bit is wrongly used as per
timer enable/disable. According to spec, comparator value should
constantly increasing when HPET is globally enabled, no matter
whether the timer interrupt is enabled or not.

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86: Fixes for S3 suspend resume:
Keir Fraser [Tue, 8 Jan 2008 10:13:11 +0000 (10:13 +0000)]
x86: Fixes for S3 suspend resume:
 - Fix wallclock resume by remembering the offset from CMOS time to
   UTC time
 - Restore dom0's CPU affinity (lost during
   continue_hypercall_on_cpu())

Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
18 years agox86, hvm: Add a perf counter for CR0.WP=0 emulation.
Keir Fraser [Tue, 8 Jan 2008 09:57:59 +0000 (09:57 +0000)]
x86, hvm: Add a perf counter for CR0.WP=0 emulation.
Signed-off-by Kevin Tian <kevin.tian@intel.com>

18 years ago[Xend] Fix 2 problems related to SR class
Keir Fraser [Tue, 8 Jan 2008 09:54:06 +0000 (09:54 +0000)]
[Xend] Fix 2 problems related to SR class

This fixes two problems related to the SR class:
- get_PBDs() was not implemented
- get_physical_size did not work

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years agoMerge with ia64 tree
Keir Fraser [Tue, 8 Jan 2008 09:45:58 +0000 (09:45 +0000)]
Merge with ia64 tree

18 years agoHandle netdev secondary addresses and labels
Keir Fraser [Tue, 8 Jan 2008 09:43:44 +0000 (09:43 +0000)]
Handle netdev secondary addresses and labels

Fix the network-bridge logic to correctly transfer secondary IP
address from $netdev to $bridge.

e.g. if you add an secondary address/label/alias with:

  $> ip addr add 172.31.0.200/24 dev eth0 label eth0:00

then, "ip addr show dev eth0" gives e.g.:

  inet 172.31.0.10/24 brd 172.31.0.255 scope global eth0
  inet 172.31.0.200/24 scope global secondary eth0:00

and transfer_addrs() tries to execute:

  ip addr add 172.31.0.10/24 brd 172.31.0.255 scope global dev tmpbridge
  ip addr add 172.31.0.200/24 scope global secondary dev tmpbridge:00

which causes the sript to fail because:

  1) The device tmpbridge:00 doesn't exist
  2) The "secondary" flag isn't valid

This patch fixes the sed commands to instead give:

  ip addr add 172.31.0.10/24 brd 172.31.0.255 scope global dev tmpbridge label tmpbridge
  ip addr add 172.31.0.200/24 scope global dev tmpbridge label tmpbridge:00

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
18 years agoHVM vif without bridge.
Keir Fraser [Tue, 8 Jan 2008 09:40:33 +0000 (09:40 +0000)]
HVM vif without bridge.
When using xen without a bridge but NAT or routing, HVM domains can't
boot, and qemu-dm-n.log contains:

config qemu network with xen bridge for  tap0 xenbr0
bridge xenbr0 does not exist!

That's because the qemu-ifup script always tries to add the vif to
a default-named xenbr0 bridge. On the contrary, PV domains just work
fine with the same configuration file except HVM parameters.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
18 years ago[IA64] Sort out the XEN_IA64_OPTF_IDENT_MAP_REG[457] constants confusion
Alex Williamson [Sun, 30 Dec 2007 20:02:16 +0000 (13:02 -0700)]
[IA64] Sort out the XEN_IA64_OPTF_IDENT_MAP_REG[457] constants confusion

Currently the constants are used for two different purpose.
one is for the OPTF hypercall sub command.
another is bit flag for struct opt_feature::mask.
They are different spaces, split them out.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] Fix PV break fault handler.
Alex Williamson [Sun, 30 Dec 2007 19:56:16 +0000 (12:56 -0700)]
[IA64] Fix PV break fault handler.

PV domain break fault handler calls C routine reflect_event() with psr.ic = 0.
It might cause unrecoverable tlb miss. set psr.ic=1 before calling it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] Fix XEN_DOMCTL_shadow_op. it should check copy_to_guest() return value.
Alex Williamson [Sun, 30 Dec 2007 19:53:54 +0000 (12:53 -0700)]
[IA64] Fix XEN_DOMCTL_shadow_op. it should check copy_to_guest() return value.

Pointed out by Samuel Thibault.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] fix vmx_switch_rr7(). uninitialized register r3 was used. initialize it.
Alex Williamson [Sun, 30 Dec 2007 19:50:09 +0000 (12:50 -0700)]
[IA64] fix vmx_switch_rr7(). uninitialized register r3 was used. initialize it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years agoAdded tag 3.2.0-rc4 for changeset c5deb251b9dcece9e466a48a66d3528ca1797db4
Keir Fraser [Sat, 29 Dec 2007 17:57:47 +0000 (17:57 +0000)]
Added tag 3.2.0-rc4 for changeset c5deb251b9dcece9e466a48a66d3528ca1797db4

18 years agoUpdate version to 3.2.0-rc4
Keir Fraser [Sat, 29 Dec 2007 17:57:37 +0000 (17:57 +0000)]
Update version to 3.2.0-rc4

18 years agovmx: Fix the 2nd argument of cpuid_count() in vmx_cpuid_intercept()
Keir Fraser [Sat, 29 Dec 2007 17:55:47 +0000 (17:55 +0000)]
vmx: Fix the 2nd argument of cpuid_count() in vmx_cpuid_intercept()

For input 0x00000004, the value of "*ecx" has been overwritten by the
cpuid() in hvm_cpuid(), causing a bad value passed to cpuid_count().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
18 years agovtpm: Fix GetCapabilityOwner function
Keir Fraser [Sat, 29 Dec 2007 17:52:34 +0000 (17:52 +0000)]
vtpm: Fix GetCapabilityOwner function

GetCapabilityOwner function's behavior is different from that of a
real tpm device. By the difference, a TPM Manager in an HVM domain
could not detect whether TPM device has an owner or not.

Signed-off-by: Kouichi YASAKI <yasaki.kouichi@jp.fujitsu.com>
18 years agoRename uintN_t guest handles to uintN, to avoid nameclash with uintN_t
Keir Fraser [Fri, 28 Dec 2007 15:44:51 +0000 (15:44 +0000)]
Rename uintN_t guest handles to uintN, to avoid nameclash with uintN_t
macros during the handle definitions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoxentrace bug fix: data format of hvmtrace is changed.
Keir Fraser [Fri, 28 Dec 2007 15:27:53 +0000 (15:27 +0000)]
xentrace bug fix: data format of hvmtrace is changed.
Signed-off-by: Disheng Su <disheng.su@intel.com>
18 years agovt-d: Only setup rmrr identity mappings of the assigned devices
Keir Fraser [Fri, 28 Dec 2007 15:26:27 +0000 (15:26 +0000)]
vt-d: Only setup rmrr identity mappings of the assigned devices

Current implementation setups identity mappings for all the rmrrs
whether the assigned device has rmrr or not. It's wasteful and not
necessary, because only USB controllers and UMA integarated graphics
devices have rmrr. This patch only setups rmrr identity mappings of
the assigned devices. If the assigned devices don't have rmrr, needn't
to setup rmrr identity mapping for guest.

BTW, this patch fixes the VT-d bug (Fail to boot smp Linux guest with
VT-d NIC assigned on IA32e platform).

Signed-off-by: Weidong Han <weidong.han@intel.com>
18 years agoIn C99 (7.19.6.2.10), the behavior of scanf("stuff... %n", ..., &n) is
Keir Fraser [Fri, 28 Dec 2007 15:23:28 +0000 (15:23 +0000)]
In C99 (7.19.6.2.10), the behavior of scanf("stuff... %n", ..., &n) is
said to be undefined if the value to be put is n can't fit.  I guess
we can safely consider that the same applies to printf.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
18 years agohvm: copy_{to,from}_user_hvm shoudl return appropriate error codes.
Keir Fraser [Thu, 27 Dec 2007 23:01:50 +0000 (23:01 +0000)]
hvm: copy_{to,from}_user_hvm shoudl return appropriate error codes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86, hvm, rombios: INT13 LBA48 support for disks bigger than 128GB.
Keir Fraser [Thu, 27 Dec 2007 13:00:40 +0000 (13:00 +0000)]
x86, hvm, rombios: INT13 LBA48 support for disks bigger than 128GB.
The new limit should be 2TB.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
18 years agoFix pygrub handling of many kernels
Keir Fraser [Thu, 27 Dec 2007 12:56:32 +0000 (12:56 +0000)]
Fix pygrub handling of many kernels

If there are a large number of kernel images configured in grub.conf
there will be too many to fit in the limited size pygrub display. This
patch fixes this so that the list of kernels scrolls as needed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
18 years agogdbstub: Various fixes.
Keir Fraser [Thu, 27 Dec 2007 12:53:57 +0000 (12:53 +0000)]
gdbstub: Various fixes.

Highlights:
- Removed panics and smp stop calls in favour of an smp pause
  mechanism.
- Added x86_64 register mapping for gdb serial protocol support.

Signed-off-by: Dan Doucette <doucette.daniel@gmail.com>
18 years agolibxc: Fix xc_domain_bind_pt_irq().
Keir Fraser [Thu, 27 Dec 2007 12:30:44 +0000 (12:30 +0000)]
libxc: Fix xc_domain_bind_pt_irq().
Signed-off-by: Guy Zana <guy@neocleus.com>
18 years agotapaio check return value from read()
Keir Fraser [Thu, 27 Dec 2007 12:28:58 +0000 (12:28 +0000)]
tapaio check return value from read()

In tools/blktap/drivers/tapaio.c there is a call to read(2) whose
return value is not checked.  The attached patch attempts to do
something vaguely sensible in cases of error.

Fully comprehensive error handling in this area would be quite tough
to introduce now but at least with this change when things go wrong
you stand a chance of getting some information about what happened.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
18 years agoFix xend xenstore handling.
Keir Fraser [Thu, 27 Dec 2007 12:27:34 +0000 (12:27 +0000)]
Fix xend xenstore handling.

xend can get into a situation where two processes are attempting to
interact with the xenstore socket, with disastrous results. Fix the
two bad users of xstransact, add a big warning, and fix the destructor
so future mistakes will be detected earlier.

Signed-off-by: John Levon <john.levon@sun.com>
18 years agovmx: Map the VLAPIC access page as mmio-direct in the p2m. This
Keir Fraser [Thu, 27 Dec 2007 12:03:02 +0000 (12:03 +0000)]
vmx: Map the VLAPIC access page as mmio-direct in the p2m. This
prevents emulated accesses to this page, which would not be handled in
the correct way (VMX handles accesses to that page in non-root mode in
a very super-special way).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: For functions which translate virtual addresses to machine
Keir Fraser [Thu, 27 Dec 2007 12:00:30 +0000 (12:00 +0000)]
hvm: For functions which translate virtual addresses to machine
addresses, page faults should only be raised when the gva->gfn
translation fails. These should be distinguished from gfn->mfn
translation failures.

The main effect of this is to change the behaviour of functions
derived from __hvm_copy(), which now returns a three-way enumeration,
and also can automatically inject #PF when the gva->gfn translation
fails.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: Cannot use ring_3() macro on HVM guests. It does not work because
Keir Fraser [Thu, 27 Dec 2007 10:41:43 +0000 (10:41 +0000)]
hvm: Cannot use ring_3() macro on HVM guests. It does not work because
the CS field is not saved/restored and also because CS.RPL does not
always equal the DPL (e.g., when executing in real mode).

Instead we must interrogate SS.DPL, or CPL directly (SVM supports this).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: Register fields CS,DS,ES,FS,GS,SS,etc. are all undefined during
Keir Fraser [Thu, 27 Dec 2007 10:39:04 +0000 (10:39 +0000)]
hvm: Register fields CS,DS,ES,FS,GS,SS,etc. are all undefined during
HVM execution as they are not saved/restore on vmexit/vmentry. To
prevent accidental usage of these fields, poison them with 16-bit
value 0xbeef (debug builds only).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agox86: Fix PAE build.
Keir Fraser [Sat, 22 Dec 2007 10:27:26 +0000 (10:27 +0000)]
x86: Fix PAE build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoUpdate version to 3.2.0-rc4-pre
Keir Fraser [Sat, 22 Dec 2007 10:27:05 +0000 (10:27 +0000)]
Update version to 3.2.0-rc4-pre

18 years agohvm: More physaddrs in unsigned longs.
Keir Fraser [Fri, 21 Dec 2007 21:59:50 +0000 (21:59 +0000)]
hvm: More physaddrs in unsigned longs.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
18 years agoAdded tag 3.2.0-rc3 for changeset ed79613b48817d5e0d1f9b3cf104c0e4e8b0d8cf
Keir Fraser [Thu, 20 Dec 2007 17:30:27 +0000 (17:30 +0000)]
Added tag 3.2.0-rc3 for changeset ed79613b48817d5e0d1f9b3cf104c0e4e8b0d8cf

18 years agoUpdate version for 3.2.0-rc3
Keir Fraser [Thu, 20 Dec 2007 17:30:20 +0000 (17:30 +0000)]
Update version for 3.2.0-rc3

18 years agoMerge with ia64 tree
Keir Fraser [Thu, 20 Dec 2007 17:28:59 +0000 (17:28 +0000)]
Merge with ia64 tree

18 years ago[qemu-dm] Fix debugging output in tpm tis model
Keir Fraser [Thu, 20 Dec 2007 16:52:44 +0000 (16:52 +0000)]
[qemu-dm] Fix debugging output in tpm tis model

This fixes the debugging output.
Also I am tweaking on the code trying to establish a connection with
the external vTPM.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years ago[IA64] Fix missing put_domain in XEN_DOMCTL_set_opt_feature
Alex Williamson [Thu, 20 Dec 2007 16:40:33 +0000 (09:40 -0700)]
[IA64] Fix missing put_domain in XEN_DOMCTL_set_opt_feature

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
18 years agoXend: don't check for device reuse if the device has no uname.
Keir Fraser [Thu, 20 Dec 2007 13:48:27 +0000 (13:48 +0000)]
Xend: don't check for device reuse if the device has no uname.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
18 years agoFix some build system error handling.
Keir Fraser [Thu, 20 Dec 2007 13:16:21 +0000 (13:16 +0000)]
Fix some build system error handling.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
18 years agolinux: Force build failure if modules build fails
Keir Fraser [Thu, 20 Dec 2007 10:44:06 +0000 (10:44 +0000)]
linux: Force build failure if modules build fails

When building a linux kernel, if the modules build fails, then
the build carries on regardless.

The problem is simple - the "make modules" failure is not seen
by the calling make since its return value is not what is
returned.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
18 years agohvm: Fix TPMD and QEMU connection
Keir Fraser [Thu, 20 Dec 2007 10:43:06 +0000 (10:43 +0000)]
hvm: Fix TPMD and QEMU connection

In HVM domain, MA_Transmit function in tcgbios sometimes become an
error (TCG_NO_RESPONSE). The cause of the error is not to make
connection of QEMU and TPMD instance within a timeout of MA_Transmit
function.

Before the MA_Transmit function was called, the attached patch
corrected so that connection of QEMU and TPMD might be completed.

Signed-off-by: Kouichi YASAKI <yasaki.kouichi@jp.fujitsu.com>
18 years agoioemu: Do not close slave half of a pty.
Keir Fraser [Thu, 20 Dec 2007 10:35:22 +0000 (10:35 +0000)]
ioemu: Do not close slave half of a pty.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoAdded tag 3.2.0-rc2 for changeset 458dc123dd02d38aaa9acb513d6f237a1c6e967e
Keir Fraser [Wed, 19 Dec 2007 15:56:10 +0000 (15:56 +0000)]
Added tag 3.2.0-rc2 for changeset 458dc123dd02d38aaa9acb513d6f237a1c6e967e

18 years agoUpdate version string for 3.2.0-rc2
Keir Fraser [Wed, 19 Dec 2007 15:56:02 +0000 (15:56 +0000)]
Update version string for 3.2.0-rc2

18 years agodoc: Fix serial console command line.
Keir Fraser [Wed, 19 Dec 2007 15:53:56 +0000 (15:53 +0000)]
doc: Fix serial console command line.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agovmx: Do not set bit 1 of FEATURE_CONTROL MSR if SMX is not supported
Keir Fraser [Wed, 19 Dec 2007 15:51:01 +0000 (15:51 +0000)]
vmx: Do not set bit 1 of FEATURE_CONTROL MSR if SMX is not supported
by the CPU. Also generally beef up robustness of VMXON instruction.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agotools/examples/block better use of losetup -r
Keir Fraser [Wed, 19 Dec 2007 15:05:15 +0000 (15:05 +0000)]
tools/examples/block better use of losetup -r

Use losetup -r when the vbd is specified to be readonly, but only if
-r is supported (rather than always creating a writeable losetup
mapping if possible).

This was inspired by (but not derived from) a diff from the Fedora 8
patchset which uses -r iff the vbd is specified as readonly.  We need
to be cleverer upstream because not all systems have losetup -r.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
18 years agoFix serial output of carriage return when using high-bit stream muxing.
Keir Fraser [Wed, 19 Dec 2007 15:02:05 +0000 (15:02 +0000)]
Fix serial output of carriage return when using high-bit stream muxing.
Original patch by Dan Doucette.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoxend: Fix device duplicate check.
Keir Fraser [Wed, 19 Dec 2007 14:51:02 +0000 (14:51 +0000)]
xend: Fix device duplicate check.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
18 years agoxend: Fix PCI Device Configuration
Keir Fraser [Wed, 19 Dec 2007 14:50:37 +0000 (14:50 +0000)]
xend: Fix PCI Device Configuration

Xend doesn't correctly work after restart, when there is a domU which
owns a pci device (driver domain). This patch fixes the problem.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
18 years agoFix master/slave handling in xenconsoled and qemu
Keir Fraser [Wed, 19 Dec 2007 14:45:45 +0000 (14:45 +0000)]
Fix master/slave handling in xenconsoled and qemu

Fix a number of problems with the pty handling:

- make openpty() implementation work on Solaris
- set raw on the slave fd, not the master, as the master doesn't
  have a line discipline pushed on Solaris
- make sure we don't leak the slave fd returned from openpty()
- don't use the 'name' argument of openpty() as it's a security risk
- note behaviour of a zero read of the master on Solaris
- remove pointless tcget/setattr

Signed-off-by: John Levon <john.levon@sun.com>
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
18 years agoxend: Indicate a resume operation
Keir Fraser [Wed, 19 Dec 2007 14:45:04 +0000 (14:45 +0000)]
xend: Indicate a resume operation

Indicate that the domain is created as part of a resume operation
rather than a 'create'.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years agohvm: Some cleanups to vlapic emulation.
Keir Fraser [Wed, 19 Dec 2007 11:14:05 +0000 (11:14 +0000)]
hvm: Some cleanups to vlapic emulation.
Some of this was suggested by Dexuan Cui.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoShadow: tidy the virtual-TLB translation cache.
Keir Fraser [Wed, 19 Dec 2007 10:11:54 +0000 (10:11 +0000)]
Shadow: tidy the virtual-TLB translation cache.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
18 years agoShadow: Make gfn_t always an unsigned long. GFNs are passed around
Keir Fraser [Wed, 19 Dec 2007 10:10:37 +0000 (10:10 +0000)]
Shadow: Make gfn_t always an unsigned long.  GFNs are passed around
outside the shadow code, and although a 32-bit gfn_t is guaranteed to
hold all GFNs that can be found in a 32-bit pagetable, comparisons
with INVALID_GFN aren't safe when (-1UL) != (u32)(-1).
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
18 years agoxentrace: Ensure virq gets sent even if we exactly hit the half water mark.
Keir Fraser [Wed, 19 Dec 2007 09:51:35 +0000 (09:51 +0000)]
xentrace: Ensure virq gets sent even if we exactly hit the half water mark.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years ago[IA64] xenoprof: don't modify mPSR.pp. VTi case
Alex Williamson [Mon, 17 Dec 2007 16:56:12 +0000 (09:56 -0700)]
[IA64] xenoprof: don't modify mPSR.pp. VTi case

Don't modify mPSR.pp for xenoprof. VTi domain case
xenoprof manages mPSR.pp so that mPSR.pp shouldn't be modified.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] xenoprof: don't modify mPSR.pp. PV case
Alex Williamson [Mon, 17 Dec 2007 16:51:06 +0000 (09:51 -0700)]
[IA64] xenoprof: don't modify mPSR.pp. PV case

Don't change mPSR.pp for xenoprof for PV domain case.
xenoprof manages mPSR.pp so that mPSR.pp shouldn't be modified.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] xenoprof: various fix on linux-xen/perfmon.c
Alex Williamson [Mon, 17 Dec 2007 16:45:53 +0000 (09:45 -0700)]
[IA64] xenoprof: various fix on linux-xen/perfmon.c

Various fixes on xen/arch/ia64/linux-xen/perfmon.c
- Fix starting/stopping sampling.
  So far IPI is used. but psr.pp isn't preserved when nested interrupt case
  with VTi domain. Instead timer is used.
- Redefines ia64_set_pmc() to enable sampling of all xen VMM/guest
  kernel/guest user process.  It supports only generic pmc/pmd.
- Twist xenpfm_write_pmcs()
  It is also used when turning on pmcs. So bailing out when error is not
  appropriate. Even when error occures, it should continue to update next
  cpu's pmcs.
- Add gdprintk(XENLOG_DEUBG) and BUG_ON()s.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] xenoprof: fix xenoprof_handler()
Alex Williamson [Mon, 17 Dec 2007 16:38:54 +0000 (09:38 -0700)]
[IA64] xenoprof: fix xenoprof_handler()

- Use profile_pc() to get instruction pointer.
- Make xenoprof_handler() VTi domain aware
- Pass current to xenoprofile_get_mode() instead of task=NULL.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] xenoprof: make xenoprofile_get_mode() vti domain aware
Alex Williamson [Mon, 17 Dec 2007 16:36:46 +0000 (09:36 -0700)]
[IA64] xenoprof: make xenoprofile_get_mode() vti domain aware

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years ago[IA64] xenoprof: fix xenoprof_shared_gmfn()
Alex Williamson [Mon, 17 Dec 2007 16:33:52 +0000 (09:33 -0700)]
[IA64] xenoprof: fix xenoprof_shared_gmfn()

fix panic after xenoprof shutdown as follows.
(XEN) Xen BUG at mm.c:1265
(XEN) FIXME: implement ia64 dump_execution_state()
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Xen BUG at mm.c:1265
(XEN) ***************************************

The c/s 14624:64ab7d443549 changed the p2m table semantics so that
xenoprof_shared_gmfn() also needs catch it up.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years agoHVM: support unaligned and page-crossing writes in the shadow emulator
Keir Fraser [Sat, 15 Dec 2007 18:29:27 +0000 (18:29 +0000)]
HVM: support unaligned and page-crossing writes in the shadow emulator
so that we can use it to support guests that clear CR0.WP.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
18 years agoxend: Prevent XenD touching externally managed bridges
Keir Fraser [Sat, 15 Dec 2007 18:26:52 +0000 (18:26 +0000)]
xend: Prevent XenD touching externally managed bridges

With current XenD 3.0.4 or later try the following:

    brctl addbr demo
    ifconfig demo up

    /etc/init.d/xend start
    /etc/init.d/xend stop

    ifconfig demo down
    brctl delbr demo

Now, start XenD again....

    /etc/init.d/xend start

And watch in horror as it re-creates your 'demo' bridge.

The problem is that the 'XendNetwork' class does not distinguish
between bridge devices that it is managing (ie those created via
XenAPI) and those which it does not manage (ie those created by OS
distro init scripts, or by apps like  libvirt).

While initially I thought I could just make XenD ignore
externally-managed bridges completely, it seems to needs to know about
them otherwise it can't hook up guest VIFs to them correctly. So the
attached patch adds a 'managed' flag to the XendNetwork
class. Externally managed bridges have this set to False. At startup
XenD will now only re-create bridge devices which have the 'managed'
flag set to 'True'  - ie those created via XenAPI.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
18 years agox86: Fix e820 walk and allocator initialisation.
Keir Fraser [Sat, 15 Dec 2007 18:23:13 +0000 (18:23 +0000)]
x86: Fix e820 walk and allocator initialisation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years ago[IA64] Fix vmx_asm_thash typo
Alex Williamson [Fri, 14 Dec 2007 17:26:06 +0000 (10:26 -0700)]
[IA64] Fix vmx_asm_thash typo

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years ago[IA64] Fix vulnerability of copy_to_user in PAL emulation
Alex Williamson [Fri, 14 Dec 2007 17:25:03 +0000 (10:25 -0700)]
[IA64] Fix vulnerability of copy_to_user in PAL emulation

There is a security vulnerability in PAL emulation since alt-dtlb
miss handler of HVM absolutely inserts a identity-mapped TLB when
psr.vm=0.  HVM guest can access an arbitrary machine physical
memory with this security hole.  Actually windows 2008 destroys
the content of machine physical address 0x108000.

I think this patch is enough for normal usage.  Please see SDM
Vol2 11.10.2.1.3 "Making PAL Procedure Calls in Physical or
Virtual Mode".  If the caller has a responsibility of providing
DTR or DTC mapping, xencomm for PAL might be unnecessary.

I confirmed there is no problem in linux, windows 2003, windows
2008 with this patch.

As for PV domain, the same logic can't be used due to only one
vTLB. This patch only checks that the buffer never points VMM
address, that would avoid the vulnerability.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
18 years agomerge with xen-unstable.hg (staging)
Alex Williamson [Fri, 14 Dec 2007 17:12:40 +0000 (10:12 -0700)]
merge with xen-unstable.hg (staging)

18 years agoSVM: Treat the vlapic's tpr as the master copy and sync the vtpr to it
Keir Fraser [Fri, 14 Dec 2007 11:50:24 +0000 (11:50 +0000)]
SVM: Treat the vlapic's tpr as the master copy and sync the vtpr to it
before every vm entry.  This fixes HVM save/restore/migrate, as the
vtpr value was only being synced on guest TPR writes before.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
18 years agohvm: Remove duplicate assignment of __HYPERVISOR_grant_table_op in
Keir Fraser [Fri, 14 Dec 2007 11:39:02 +0000 (11:39 +0000)]
hvm: Remove duplicate assignment of __HYPERVISOR_grant_table_op in
hypercall demux tables.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agocpufreq: Always return successfully from cpufreq MSR traps
Keir Fraser [Fri, 14 Dec 2007 11:37:02 +0000 (11:37 +0000)]
cpufreq: Always return successfully from cpufreq MSR traps
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agohvm: Remove guest-triggerable assertions from vlapic emulation.
Keir Fraser [Fri, 14 Dec 2007 10:48:18 +0000 (10:48 +0000)]
hvm: Remove guest-triggerable assertions from vlapic emulation.

Currently our VLAPIC will happily deliver interrupts on vectors <
16. This could be emulated better, but probably does not matter.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
18 years agoxenoprof: Fix more than one events can't be sampled concurrently for Intel CPU with...
Keir Fraser [Fri, 14 Dec 2007 10:34:22 +0000 (10:34 +0000)]
xenoprof: Fix more than one events can't be sampled concurrently for Intel CPU with family equal to 6

The original code only sets EN bit of IA32_PERFEVTSEL0 when profiling
is started.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
18 years agoacm, xend: Serialize the execution of external scripts.
Keir Fraser [Fri, 14 Dec 2007 10:26:11 +0000 (10:26 +0000)]
acm, xend: Serialize the execution of external scripts.

Instead of starting a thread per script, run a single thread and send
orders to it. This serializes the execution of the scripts.

Signed-off-by: Stefan Berger <stefanB@us.ibm.com>
18 years agoxenoprof: flush remaining smples when sampling is stopped.
Keir Fraser [Fri, 14 Dec 2007 10:25:00 +0000 (10:25 +0000)]
xenoprof: flush remaining smples when sampling is stopped.

Xenoprof notifies guest kernel via VIRQ_XENOPROF when sampled.
But it does coarsly based on heuristic so that sometimes VIRQ_XENOPROF
isn't delivered resulting in that oprofile daemon collects no sample.
To avoid that situation, always send VIRQ_XENOPROF when sampling is
stopped.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
18 years agodocs: Adds VT-d testing combinations and lists OS which VT-d works on.
Keir Fraser [Fri, 14 Dec 2007 10:22:08 +0000 (10:22 +0000)]
docs: Adds VT-d testing combinations and lists OS which VT-d works on.
Signed-off-by: Weidong Han <weidong.han@intel.com>
18 years agoxsm: Implement missing functions in XSM dummy module
Keir Fraser [Fri, 14 Dec 2007 10:17:50 +0000 (10:17 +0000)]
xsm: Implement missing functions in XSM dummy module

I am implementing some missing interface functions in the XSM dummy
module. Also deactivating some debugging output.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
18 years agotools: Some fixes for 'make clean'.
Keir Fraser [Fri, 14 Dec 2007 10:16:52 +0000 (10:16 +0000)]
tools: Some fixes for 'make clean'.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
18 years agoxenstore size limits
Keir Fraser [Fri, 14 Dec 2007 10:15:00 +0000 (10:15 +0000)]
xenstore size limits

 * Documents the existing 4kby size limit on xenstore message payloads
 * Causes xs.c in libxenstore to fail locally rather than violating
   said limit (which is good because xenstored kills the client
   connection if it's exceeded).
 * Introduces some limits on path lengths in xenstored.  I trust
   no-one is using path lengths >2kby.  This is good because currently
   a domain client can create a 4kby relative path that the dom0 tools
   cannot access since they'd have to specify the somewhat longer
   absolute path.
 * Removes uses of the host's PATH_MAX (!)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>